3.1.57 \(\int \frac {\csc ^2(c+d x)}{a+b \tan (c+d x)} \, dx\) [57]

Optimal. Leaf size=50 \[ -\frac {\cot (c+d x)}{a d}-\frac {b \log (\tan (c+d x))}{a^2 d}+\frac {b \log (a+b \tan (c+d x))}{a^2 d} \]

[Out]

-cot(d*x+c)/a/d-b*ln(tan(d*x+c))/a^2/d+b*ln(a+b*tan(d*x+c))/a^2/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3597, 46} \begin {gather*} -\frac {b \log (\tan (c+d x))}{a^2 d}+\frac {b \log (a+b \tan (c+d x))}{a^2 d}-\frac {\cot (c+d x)}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]^2/(a + b*Tan[c + d*x]),x]

[Out]

-(Cot[c + d*x]/(a*d)) - (b*Log[Tan[c + d*x]])/(a^2*d) + (b*Log[a + b*Tan[c + d*x]])/(a^2*d)

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 3597

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rubi steps

\begin {align*} \int \frac {\csc ^2(c+d x)}{a+b \tan (c+d x)} \, dx &=\frac {b \text {Subst}\left (\int \frac {1}{x^2 (a+x)} \, dx,x,b \tan (c+d x)\right )}{d}\\ &=\frac {b \text {Subst}\left (\int \left (\frac {1}{a x^2}-\frac {1}{a^2 x}+\frac {1}{a^2 (a+x)}\right ) \, dx,x,b \tan (c+d x)\right )}{d}\\ &=-\frac {\cot (c+d x)}{a d}-\frac {b \log (\tan (c+d x))}{a^2 d}+\frac {b \log (a+b \tan (c+d x))}{a^2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.15, size = 47, normalized size = 0.94 \begin {gather*} \frac {-a \cot (c+d x)+b (-\log (\sin (c+d x))+\log (a \cos (c+d x)+b \sin (c+d x)))}{a^2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]^2/(a + b*Tan[c + d*x]),x]

[Out]

(-(a*Cot[c + d*x]) + b*(-Log[Sin[c + d*x]] + Log[a*Cos[c + d*x] + b*Sin[c + d*x]]))/(a^2*d)

________________________________________________________________________________________

Maple [A]
time = 0.25, size = 48, normalized size = 0.96

method result size
derivativedivides \(\frac {\frac {b \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{2}}-\frac {1}{a \tan \left (d x +c \right )}-\frac {b \ln \left (\tan \left (d x +c \right )\right )}{a^{2}}}{d}\) \(48\)
default \(\frac {\frac {b \ln \left (a +b \tan \left (d x +c \right )\right )}{a^{2}}-\frac {1}{a \tan \left (d x +c \right )}-\frac {b \ln \left (\tan \left (d x +c \right )\right )}{a^{2}}}{d}\) \(48\)
risch \(-\frac {2 i}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{a^{2} d}-\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{2} d}\) \(82\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)^2/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(b/a^2*ln(a+b*tan(d*x+c))-1/a/tan(d*x+c)-b/a^2*ln(tan(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.34, size = 47, normalized size = 0.94 \begin {gather*} \frac {\frac {b \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2}} - \frac {b \log \left (\tan \left (d x + c\right )\right )}{a^{2}} - \frac {1}{a \tan \left (d x + c\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

(b*log(b*tan(d*x + c) + a)/a^2 - b*log(tan(d*x + c))/a^2 - 1/(a*tan(d*x + c)))/d

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 95, normalized size = 1.90 \begin {gather*} \frac {b \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) \sin \left (d x + c\right ) - b \log \left (-\frac {1}{4} \, \cos \left (d x + c\right )^{2} + \frac {1}{4}\right ) \sin \left (d x + c\right ) - 2 \, a \cos \left (d x + c\right )}{2 \, a^{2} d \sin \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(b*log(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2)*sin(d*x + c) - b*log(-1/4*cos(d
*x + c)^2 + 1/4)*sin(d*x + c) - 2*a*cos(d*x + c))/(a^2*d*sin(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc ^{2}{\left (c + d x \right )}}{a + b \tan {\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)**2/(a+b*tan(d*x+c)),x)

[Out]

Integral(csc(c + d*x)**2/(a + b*tan(c + d*x)), x)

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 60, normalized size = 1.20 \begin {gather*} \frac {\frac {b \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2}} - \frac {b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a^{2}} + \frac {b \tan \left (d x + c\right ) - a}{a^{2} \tan \left (d x + c\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

(b*log(abs(b*tan(d*x + c) + a))/a^2 - b*log(abs(tan(d*x + c)))/a^2 + (b*tan(d*x + c) - a)/(a^2*tan(d*x + c)))/
d

________________________________________________________________________________________

Mupad [B]
time = 3.74, size = 39, normalized size = 0.78 \begin {gather*} \frac {2\,b\,\mathrm {atanh}\left (\frac {2\,b\,\mathrm {tan}\left (c+d\,x\right )}{a}+1\right )}{a^2\,d}-\frac {\mathrm {cot}\left (c+d\,x\right )}{a\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(c + d*x)^2*(a + b*tan(c + d*x))),x)

[Out]

(2*b*atanh((2*b*tan(c + d*x))/a + 1))/(a^2*d) - cot(c + d*x)/(a*d)

________________________________________________________________________________________